package cn.wzvtcsoft.sys.entity;

import cn.wzvtcsoft.base.BaseEntry;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.Objects;

/**
 * @author swxu_2005@163.com
 * @date 2018/9/24
 */
@Setter
@Getter
@Entity(name = "sys_role_permission")
public class RolePermission extends BaseEntry {

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "role_id")
  @Access(AccessType.PROPERTY)
  public Role getParent() {
    return (Role) this.parent;
  }

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "permission_id")
  private Permission permission;

}
